<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>vue</title>
    <script src='https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js'></script>
</head>

<body>
    <div id='app'>
        <!-- 按键抬起时触发 -->
        <!-- <input type="text" @keyup="keyup" /> -->
        <!-- 回车键触发 -->
        <!-- <input type="text" @keyup.enter="keyup" /> -->
        <!-- 回车键 + ctrl 同时按下触发 -->
        <!-- <input type="text" @keyup.enter.ctrl="keyup" /> -->
        <!-- 通过 asc 码触发 -->
        <input type="text" @keyup.65="keyup" />
    </div>
</body>
<script>
    /* 
        按键修饰符：
            .esc .up .down .up .left .right
            .space .ctrl .shift .delete
    */
    let vm = new Vue({
        el: '#app',
        methods: {
            keyup(evt) {
                console.log("keyup:", evt.keyCode);
            }
        }
    });
</script>

</html>